package com.smart.model.convert;

import com.smart.model.dtomapper.JiansheUnitDtoMapper;
import com.smart.model.domain.JiansheUnitDO;
import com.smart.model.vo.JiansheUnitVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class JiansheUnitConvert {

    public static List<JiansheUnitVO> buildJiansheUnitVoList(List<JiansheUnitDO> jiansheUnitDOList) {
        if (CollectionUtils.isEmpty(jiansheUnitDOList)) {
            return Lists.newArrayList();
        }
        List<JiansheUnitVO> jiansheUnitVOList = new ArrayList<>();
        for (JiansheUnitDO jiansheUnitDO : jiansheUnitDOList) {
            jiansheUnitVOList.add(JiansheUnitDtoMapper.INSTANCE.do2VO(jiansheUnitDO));
        }

        return jiansheUnitVOList;
    }
}
